<template>
    <div>
        <h2>这是父组件的消息</h2>
        <h2>以下是子组件的消息</h2>
        <hr/>
        
        
        <child :message="parentMessage"  @message-sent="handleMessage"></child>
    

        
    </div>
</template>

<script setup>
import child from './child.vue'

const parentMessage = '来自父组件的消息'

function handleMessage(message) {
  console.log('接收到了子组件的消息:', message);
  alert('我是你爸爸',message);
}


</script>